﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="stuclass.aspx.cs" Inherits="person_stuclass" %>

<!--#include file="../checkLog.inc" -->
<!--
//*******************************
//** 设计人员：   Enjsky
//** 设计日期：   2010-07-31
//** 联系邮箱：   enjsky@163.com
//*******************************
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:element>
<head>
    <title>查询班级列表</title>
    <link rel="stylesheet" type="text/css" href="../css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="../css/efs-all.css" />
    <script type="text/javascript" src="../js/loadmask.js"></script>
    <script type="text/javascript" src="../js/efs-all.js"></script>
    <script language="javascript">

        // 页面初始化操作
        Efs.onReady(function () {
            Efs.getDom("classList").setAttribute("txtXML", Efs.Common.getQryXml());
            //Efs.getDom("classList").txtXML = Efs.Common.getQryXml();
            Efs.getExt("classgrid").store.load();
        });
        // 进入查询
        function doQry() {
            var strXml = Efs.Common.getQryXml(Efs.getExt("frmQry"));
            Efs.getDom("classList").setAttribute("txtXML", strXml);
            Efs.getExt("classgrid").store.load();
        }


        var classid = "";
        function doGridClick(data) {
            classid = data["CLASSID"];
            Efs.getExt("cmdEdit").enable();
            Efs.getExt("cmdDel").enable();
        }

        function doAdd() {
            // 注意这里是getDom
            Efs.getExt("frmPost").reset();
            // 下面两个是 getDom  // 修改属性，配置为insert操作
            Efs.getDom("classid").setAttribute("operation", "0");
            Efs.getDom("classid").setAttribute("state", "0");
            Efs.getDom("frmPost").setAttribute("url", "../sysadmin/baseRefWeb.aspx?method=ClassAdd");
            with (Efs.getExt("classWindow")) {
                setTitle("添加班级");
                show();
            }
        }

        function onEditEx() {
            showEdit();
        }

        function showEdit() {
            if (classid == "") {
                alert("请选择需要修改的班级");
                return false;
            }
            Efs.getExt("frmPost").reset();
            Efs.Common.ajax("../sysadmin/baseRefWeb.aspx?method=stuClassDetail&CLASSID=" + classid, "", function (succ, xml_http, options) {
                if (succ) { // 是否成功
                    var xmlReturnDoc = xml_http.responseXML;
                    Efs.Common.setEditValue(xmlReturnDoc, Efs.getExt("frmPost"), "QUERYINFO");
                }
                else {
                    alert("加载数据失败!");
                }
            });
            // 注意这里是getDom
           Efs.getDom("frmPost").setAttribute("url", "../sysadmin/baseRefWeb.aspx?method=ClassEditOrDel");
            // 下面两个是 getDom  // 修改属性，配置为update操作
            Efs.getDom("classid").setAttribute("operation", "1");
            Efs.getDom("classid").setAttribute("state", "5");
            with (Efs.getExt("classWindow")) {
                setTitle("修改班级");
                show();
            }
        }
        function doDel() {
            var strXml = Efs.getExt("classgrid").getDelXml();
            Efs.getDom("frmPost").setAttribute("url", "../sysadmin/baseRefWeb.aspx?method=ClassEditOrDel");
            Efs.getExt("frmPost").submit(strXml);
        }
        function doSubmit() {
            Efs.getExt("frmPost").submit();
        }

        function reRet() {
            Efs.getExt("frmPost").reset();
        }

        // 获取异步提交的返回监听函数
        function frmPostSubBack(bln, from, action) {
            if (bln) {
               // Efs.getExt("classWindow").hide();
                doQry();
            }
            else {
                var xml_http = action.response;
                if (xml_http != null) {
                    var objXML = xml_http.responseXML;

                    alert("处理失败：" + objXML.selectSingleNode("//FUNCERROR").text);
                    objXML = null;
                    xml_http = null;
                }
            }
        }
    </script>
</head>
<body>
    <div iconcls="icon-panel" title="班级列表" id="classgrid" region="center" xtype="grid"
        pagingbar="true" pagesize="25" onefsrowclick="doGridClick()" onefsrowdblclick="onEditEx()">
        <div xtype="tbar">
            <div text="->">
            </div>
            <div iconcls="icon-add" id="cmdAdd" text="添加班级#A" onefsclick="doAdd()">
            </div>
            <div text="-">
            </div>
            <div iconcls="icon-edit" id="cmdEdit" text="修改班级#E" onefsclick="onEditEx()" disabled>
            </div>
            <div text="-">
            </div>
            <div iconcls="icon-del" id="cmdDel" text="删除班级#D" onefsclick="doDel()" disabled>
            </div>
        </div>
        <div id="classList" xtype="store" url="../sysadmin/baseRefWeb.aspx?method=stuClassList"
            txtxml="" autoload="false">
            <div xtype="xmlreader" fieldid="CLASSID" record="ROW" tabname="apt_class" totalrecords="QUERYINFO@records">
                <div name="CLASSID">
                </div>
                <div name="CLASSNAME">
                </div>
                <div name="MAJOR"></div>
                <div name="STAGE"></div>
                <div name="CLASSDES">
                </div>
            </div>
        </div>
        <div xtype="colmodel">
            <div type="radio">
            </div>
            <div header="班级编码" width="80" sortable="true" align="center" dataindex="CLASSID" >
            </div>
            <div header="班级名称" width="100" sortable="true" align="center" dataindex="CLASSNAME">
            </div>
            <div header="技术方向" width="100" sortable="true" align="center" dataindex="MAJOR" kind="dic" src="DIC_MAJOR"></div>
            <div header="S1/S2/Y2" width="100" sortable="true" align="center" dataindex="STAGE" kind="dic" src="DIC_STAGE"></div>
            <div header="班级描述" width="220" sortable="true"  dataindex="CLASSDES">
            </div>
        </div>
    </div>
    <!--window开始-->
    <div iconcls="icon-panel" id="classWindow" xtype="window" width="500" height="235">
        <form id="frmPost" class="efs-box" method="post" url="" onefssuccess="frmPostSubBack(true)"
        onefsfailure="frmPostSubBack(false)">
        <table class="formArea">
            <tr>
                <td labelfor="pname">
                    班级名称
                </td>
                <td>
                    <input id="pname" type="text" kind="text" fieldname="apt_class/CLASSNAME" state="0"
                        datatype="0" value="" must="true">
                </td>
            </tr>
            <tr>
            <td labelfor="pmajor">技术方向</td>
            <td><input id="pmajor" type="text" kind="dic" src="DIC_MAJOR" fieldname="apt_class/MAJOR" state="0" datatype="1" /></td>
            </tr>
             <tr>
            <td labelfor="pstage">目前阶段</td>
            <td><input id="pstage" type="text" kind="dic" src="DIC_STAGE" fieldname="apt_class/STAGE" state="0" datatype="1" /></td>
            </tr>
            <tr>
                <td>
                    描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述
                </td>
                <td>
                    <textarea kind="text" style="height: 60px; width: 380px" fieldname="apt_class/CLASSDES"
                        state="0" datatype="0"></textarea>
                </td>
            </tr>
        </table>
        <input id="classid" type="hidden" kind="text" fieldname="apt_class/CLASSID" operation="0"
            writeevent="0" state="5" datatype="0" />
        </form>
        <div xtype="buttons">
            <div iconcls="icon-ok" text="提  交" onefsclick="doSubmit()"></div>
            <div iconcls="icon-reset" text="清  空" onefsclick="reRet()"></div>
        </div>
    </div>
</body>
</html>
